package com.whh.controller;

import com.whh.config.vo.ResultCode;
import com.whh.config.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.whh.entity.ResultEntity;
import com.whh.entity.SysUserEntity;
import com.whh.service.SysUserService;

@RestController
@RequestMapping(value = "/user")
public class SysUserController extends BaseController<SysUserEntity> {
	
	@Autowired
	public SysUserController(SysUserService service) {
		super();
		setService(service);
	}
	
	@Autowired
	SysUserService service;
	
	@RequestMapping(value="/setBaseInfo",method=RequestMethod.POST)
	@ResponseBody
	public ResultVO<SysUserEntity> commit(SysUserEntity entity) {
		entity.setLastLoginTime("");
		entity.setVisitsNum(0);
		return new ResultVO<>(ResultCode.SUCCESS,service.update(entity));
	}
}
